Computer programs rely on objects, which are structures that group together variables and may also include functions. A program may use thousands of objects during its execution. The program may instantiate the objects or read them from a stream. In both cases the object may contain illegal values. Unfortunately, most programs fail to generate an error when encountering illegal values or they do so incorrectly. This causes unexpected behavior and may further lead to resource leakage. In particular, executors, which represent thread pools, may not be shutdown, further exacerbating the problem. Programs with unexpected behavior can lead to substantial financial losses and service interruption.